package com.example.uiclassassignments.tools;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.uiclassassignments.R;

public class ToastUtils {
    public static void showTextToas(Context context, String message) {
        View toastview = LayoutInflater.from(context).inflate(R.layout.toast_style, null);
        TextView text = toastview.findViewById(R.id.tv);
        text.setText(message);
        Toast toast = new Toast(context);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.setDuration(Toast.LENGTH_SHORT);
        toast.setView(toastview);
        toast.show();
    }
}
